From https://signalk.org/ :
Signal K is a modern and open data format for marine use. Built on standard web technologies including JSON, WebSockets and HTTP, Signal K provides a method for sharing information in a way that is friendly to WiFi, cellphones, tablets and the Internet.
Technical specification: https://signalk.org/specification/1.3.0/doc/
Courtesy of teppokurki ; cf. http://www.cruisersforum.com/forums/f134/plugin-dashboard-44087-38.html#post3011281 :
Signal K defines paths that are used to tell what a datum is: navigation.speedOverGround or environment/outside/temperature.
So instead of encoding speedOverGround in a cryptic message like $GNRMC,001031.00,A,4404.13993,N,12118.86023,W,0.14 6,,100117,,,A*7B (NMEA0183) or 8,00,4e,01,ff,ff,00,ff,ff (NMEA2000 pgn 128259 data as hex) we send a message like
{“path”:“navigation.speedOverGround”, “value”: 3.34}
It also defines standard units for each path in a schema.
Courtesy of teppokurki ; cf. http://www.cruisersforum.com/forums/f134/plugin-dashboard-44087-38.html#post3011281 :
Signal K specification defines how an application can
in a modern , internet, browser and smartphone friendly way.
In OpenCPN each plugin must parse the NMEA0183 data separately - there is no central data model. Contrast that to a SK server, where all incoming data, be it NMEA2000 or NMEA0183 or some other non-NMEA sensor data, is converted first to Signal K and then made available to all the different parts of the system.
In this thread there has been talk about different plugins doing calculations differently. In a SK system we can also derive data, for example calculate true wind, and this derived data will be available like the original sensor data for all applications. Another example would be applying calibration to incoming data: I have a piece of code that adjusts magnetic heading to parameters specific to my boat. This is also done once and the adjusted data is what is available for all displays/gauges.
All data in a uniform data model makes dealing with it much easier. A few days ago somebody asked about sending Signal K data to a cloud IoT database. This is what the code to do that looks like
const ws = new WebSocket('ws://localhost:3000/signalk/v1/stream')
ws.on('message', function incoming(data) {
const msg = JSON.parse(data)
msg.updates && msg.updates.forEach(update => {
update.values && update.values.forEach(pathValue => {
const msgOut = {}
msgOut[pathValue.path] = pathValue.value
const theMsg = JSON.stringify(msgOut)
client.publish('v1/devices/me/telemetry', theMsg)
})
})
})
From an application developer's perspective this is a lot easier than dealing with NMEA data. The ability to store the data in a database easily and draw graphs based on it that conachair touts comes from the uniformness: you don't need to write separate logic for each and every datum, just a single mechanism for writing SK data to the db.
In fact one motivation for myself when starting out with Signal K was the need to have one way to deal with various data: I had written some code for myself based on NMEA0183. Next season I switched my wind gear to NMEA2000. Instead of rewriting the code in an NMEA2000 specific way I converted it to use a data format that does not really care where the data is coming from.
At the same time you get the benefit of easily debugging stuff: it is way easier to figure out what's happening if you see a SK path compared to unparsed NMEA data.
With Node Signal K Server you get some other niceties, like * appstore where you can install & update extensions (for example derived data formulae or plugins for writing SK data into databases locally or in the cloud) and webapps (customizable dashboards and gauges that work in browser on computers and smartphones) * secure and authenticated access to your data * playback & snapshot support: the ability to stream or retrieve historical data * logging: you can log all your data but these are not part of the Signal K specification, data model and protocol, merely features of this particular software.
Courtesy to rgleason,canne, cf: http://www.cruisersforum.com/forums/f134/signal-k-155383-8.html#post3021434
The SIgnal K data model https://signalk.org/specification/1.3.0/doc/data_model.html defines not only the full model but also the delta format: https://signalk.org/specification/1.3.0/doc/data_model.html#delta-format :
Moreover, in the documentation made for the plug-in authors, delta is described https://github.com/SignalK/signalk-server-node/blob/master/SERVERPLUGINS.md#deltas
This model, allows the programmers and developers of us to deal with the data arriving from a Signal K server's delta channel like if we would be directly connected to the source of the data, if its NMEA-0183 or NMEA-2000 or something else.
The port providing delta channel is, on Signal node server for node.js is 8375, try http://localhost:8375 with your browser (does not work with all browsers, try another one or use wget, nc or other command-line program) to study what you have from your system.
Some existing code, the following is a permalink to an existing and well tested Signal K delta data streaming read project:
- the Signal K Streamer delta channel socket listening + parser thread starts here:
- the Signal K Streamer delta message parsing to internal format (of Dashboard in this case) is starting from this line in the thread: